<html>
<head><meta charset="utf-8"><title>New Lint Request: missing_top_level_docs · t-lang · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/213817-t-lang/index.html">t-lang</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/213817-t-lang/topic/New.20Lint.20Request.3A.20missing_top_level_docs.html">New Lint Request: missing_top_level_docs</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="223735076"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/213817-t-lang/topic/New%20Lint%20Request%3A%20missing_top_level_docs/near/223735076" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Lokathor <a href="https://rust-lang.github.io/zulip_archive/stream/213817-t-lang/topic/New.20Lint.20Request.3A.20missing_top_level_docs.html#223735076">(Jan 23 2021 at 06:36)</a>:</h4>
<p>(name to be bikeshed)</p>
<p>What I'd like is a way to signal that I want to require docs on modules / types / functions, without having to put docs on every individual field and every individual enum branch. Yes, there's <code>allow(missing_docs)</code> but then you have to put it on every single type you write. If you're making a lot of structs, that becomes bothersome. It seems like this should be a simple thing to set once and have the compiler know what you mean.</p>
<p>This could also arguably be a new way to use the existing <code>missing_docs</code> lint. Something like:</p>
<div class="codehilite" data-code-language="Rust"><pre><span></span><code><span class="cp">#![deny(missing_docs(top_level))]</span><span class="w"></span>
</code></pre></div>
<p>Again, "name to be bikeshed".</p>



<a name="223752356"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/213817-t-lang/topic/New%20Lint%20Request%3A%20missing_top_level_docs/near/223752356" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/213817-t-lang/topic/New.20Lint.20Request.3A.20missing_top_level_docs.html#223752356">(Jan 23 2021 at 14:32)</a>:</h4>
<p>Would it make sense to do the reverse? <code>allow(missing_field_docs)</code>, which would undo the effect on fields only?</p>



<a name="223763119"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/213817-t-lang/topic/New%20Lint%20Request%3A%20missing_top_level_docs/near/223763119" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Lokathor <a href="https://rust-lang.github.io/zulip_archive/stream/213817-t-lang/topic/New.20Lint.20Request.3A.20missing_top_level_docs.html#223763119">(Jan 23 2021 at 18:32)</a>:</h4>
<p>Sure. The main thing I'm after is that it work crate-wide insead of per-struct.</p>



<a name="223768088"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/213817-t-lang/topic/New%20Lint%20Request%3A%20missing_top_level_docs/near/223768088" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/213817-t-lang/topic/New.20Lint.20Request.3A.20missing_top_level_docs.html#223768088">(Jan 23 2021 at 19:20)</a>:</h4>
<p>Seems perfectly reasonable to me.</p>



<a name="223769696"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/213817-t-lang/topic/New%20Lint%20Request%3A%20missing_top_level_docs/near/223769696" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/213817-t-lang/topic/New.20Lint.20Request.3A.20missing_top_level_docs.html#223769696">(Jan 23 2021 at 19:35)</a>:</h4>
<p>I have no strong opinion, just want to mention that missing_docs is part of rustc proper, not rustdoc</p>



<a name="223770689"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/213817-t-lang/topic/New%20Lint%20Request%3A%20missing_top_level_docs/near/223770689" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/213817-t-lang/topic/New.20Lint.20Request.3A.20missing_top_level_docs.html#223770689">(Jan 23 2021 at 19:44)</a>:</h4>
<p><span class="user-mention silent" data-user-id="232545">Joshua Nelson</span> <a href="#narrow/stream/213817-t-lang/topic/New.20Lint.20Request.3A.20missing_top_level_docs/near/223769696">said</a>:</p>
<blockquote>
<p>I have no strong opinion, just want to mention that missing_docs is part of rustc proper, not rustdoc</p>
</blockquote>
<p>I'd assume that the new lint would be part of rustc as well.</p>



<a name="223772971"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/213817-t-lang/topic/New%20Lint%20Request%3A%20missing_top_level_docs/near/223772971" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/213817-t-lang/topic/New.20Lint.20Request.3A.20missing_top_level_docs.html#223772971">(Jan 23 2021 at 20:13)</a>:</h4>
<p>(I split the other posts into a <a href="#narrow/stream/213817-t-lang/topic/Make.20rustdoc.20lints.20a.20tool.20lint.20instead.20of.20built-in.20.23.2080527">separate topic</a>.)</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>